def one(x):
    if x < 4 or x % 4 != 0:
        return 'No'
    a = (x - 4) // 4 

    if a <= 0 or a % 2 == 0:
        return 'No'
    b = a + 2
    return f'Yes\n{a} {b}'

def method(nums):
    ans = []
    for x in nums:
        ans.append(one(x))
    return ans 

n = int(input())
nums = []
for _ in range(n):
    nums.append(int(input()))
ans = method(nums)

for t in ans:
    print(t)
